import request from "./request";

/**
 *注册新用户
 * @param registerUser
 */
export function registerNewUser(user) {
    return request(
        {
            url: '/user/register',
            method: 'post',
            data: user
        }
    );
}

/**
 *获取页面复合数据
 * @param registerUser
 */
export function getPageDataServer() {
    return request(
        {
            url: '/page/pagedata/find',
            method: 'get',
        }
    );
}

/**
 *获取用户列表
 * @param registerUser
 */
export function getUserListByGroupIdServer(groupId) {
    return request(
        {
            url: '/user/find/list/' + groupId,
            method: 'get',
        }
    );
}

/**
 *修改资源
 * @param registerUser
 */
export function updateCategoryServer(category) {
    return request(
        {
            url: '/page/category/update',
            method: 'put',
            data: category
        }
    );
}

/**
 *修改资源
 * @param registerUser
 */
export function updateSourceServer(sources) {
    return request(
        {
            url: '/page/sources/update',
            method: 'put',
            data: sources
        }
    );
}

/**
 *修改资源
 * @param registerUser
 */
export function addNewSourcesServer(sources) {
    return request(
        {
            url: '/page/sources/add',
            method: 'post',
            data: sources
        }
    );
}

/**
 *修改资源
 * @param registerUser
 */
export function addNewCategoryServer(category) {
    return request(
        {
            url: '/page/category/add',
            method: 'post',
            data: category
        }
    );
}

/**
 *修改资源
 * @param registerUser
 */
export function delCategoryServer(categoryId) {
    return request(
        {
            url: '/page/category/del/' + categoryId,
            method: 'delete'
        }
    );
}

